﻿@using System.Web.Optimization
@model YmtRpc.Web.Admin.Models.LoginViewModel

@{
    Layout = null;
    ViewBag.Title = "登录";
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>@ViewBag.Title - 风控后台管理系统</title>
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")
    @Scripts.Render("~/bundles/jquery")
    @Scripts.Render("~/bundles/bootstrap")
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            $('#loginModal').modal('hide').css({
                'margin-top': function () {
                    var modalHeight = $('#loginModal').find('.modal-dialog').height();
                    return ($(window).height() - modalHeight) / 2;
                }
            });
        });
    </script>


</head>
<body>
    <div id="loginModal" class="modal show">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h1 class="text-center text-primary">登录</h1>
                </div>
                <div class="modal-body">
                    <div class="col-md-12">
                        <section id="loginForm">
                            @using (Html.BeginForm("Login", "Account", new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { @class = "form-horizontal", role = "form" }))
                            {
                                @*@Html.AntiForgeryToken()*@

                                @Html.ValidationSummary(true)
                                <div class="form-group">
                                    @Html.LabelFor(m => m.LoginId, new { @class = "col-md-3 control-label" })
                                    <div class="col-md-6">
                                        @Html.TextBoxFor(m => m.LoginId, new { @class = "form-control" })
                                        @Html.ValidationMessageFor(m => m.LoginId)
                                    </div>
                                </div>
                                <div class="form-group">
                                    @Html.LabelFor(m => m.Password, new { @class = "col-md-3 control-label" })
                                    <div class="col-md-6">
                                        @Html.PasswordFor(m => m.Password, new { @class = "form-control" })
                                        @Html.ValidationMessageFor(m => m.Password)
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-offset-3 col-md-6">
                                        <div class="checkbox">
                                            @Html.CheckBoxFor(m => m.RememberMe)
                                            @Html.LabelFor(m => m.RememberMe)
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-md-offset-3 col-md-6">
                                        <input type="submit" value="登录" class="btn btn-primary btn-lg btn-block" />
                                    </div>
                                </div>

                            }
                        </section>

                        @{
                            if (ViewBag.ErrorMessage != null)
                            {
                                <div class="alert alert-danger" role="alert">@ViewBag.ErrorMessage</div>
                            }
                        }
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>